﻿using System;
using System.Data;
using System.Data.Objects;
using System.Data.SqlClient;
using EntityModel;

namespace DataAccess
{
    public abstract class ExecuteHelperBase<T, U> : DataAccessBase
        where T : EntityBase, new()
        where U : UserModel
    {
        public ExecuteHelperBase() : base() { }
        
        public abstract T Insert(T entity, U UserInfo);
        public abstract T Update(T entity, U UserInfo);
        public abstract T Delete(T entity, U UserInfo);
        public abstract T DeleteByKey(Int32 key, U UserInfo);
        public abstract Result<T> ExecuteQuery(string procedureName, U UserInfo, params ObjectParameter[] parameters);
        public abstract Result<DataRow> ExecuteQueryToDataRow(string procedureName, U UserInfo, params SqlParameter[] parameters);
        public abstract bool ExecuteNonQuery(string procedureName, U UserInfo, params SqlParameter[] parameters);
        public abstract int ExecuteScalar(string procedureName, U UserInfo, params SqlParameter[] parameters);
    }
}
